<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <ui:composition template="/template.xhtml">
        <ui:define name="content">
            <f:view>
                <h:form>
                    <p:panel header="Send FeedBack" style="text-align: center;width: 100%">
                        <p:messages />
                        <center>
                        <p:panelGrid columns="2">
                            <h:outputLabel value="Title:" for="title" />
                            <p:inputText id="txtTitle" value="#{feedbackController.current.title}" style="width: 290px" title="Title"
                                         required="true" validatorMessage="Length of Title maximum 30 !" requiredMessage="Title field cannot blank !">
                                <f:validateLength maximum="30" />
                            </p:inputText>
                            <h:outputLabel value="Content:" for="Content" />
                            <p:inputTextarea id="txtContent" value="#{feedbackController.current.content}" title="Content"
                                             cols="40" rows="5" required="true" requiredMessage="Content field cannot blank ! !"/>
                        </p:panelGrid>
                        <br/>
                        <p:commandButton id="btnCancel" action="#{feedbackController.prepareListFB}" value="Cancel" ajax="false"
                                     immediate="true" icon="ui-icon-arrowrefresh-1-w" style="width: 120px;"/>
                        <p:commandButton value="Send" action="#{feedbackController.insertFB}" icon="ui-icon-arrowthickstop-1-n" ajax="false"  style="width: 120px;"/>
                        </center>
                    </p:panel>
                </h:form>
            </f:view>
        </ui:define>
    </ui:composition>
</html>
